/* 
 * File:   Bonus.h
 * Author: paula
 *
 * Created on 19 de noviembre de 2014, 12:35
 */

#ifndef BONUS_H
#define	BONUS_H

#include "../Define/DefaultValues.h"
#include "../Define/Structs.h"
#include <string>
#include <chrono>
#include "Object.h"
#include "WorldElement.h"
#include "ObjFactory.h"
#include "Dot.h"

using namespace std;

class Bonus : public WorldElement {
public:
    Bonus();
    Bonus(ObjFactory *objFactory, int id, float x, float y);
    Bonus(const Bonus& orig);
    virtual ~Bonus();

    struct ObjectInit getData();
    void updatePosition();
    void updateRotation();

    void updateData();
    void setUbicDyn(int id);
    void checkChanges();
    bool getAreEquals();

    void kill();
    void revive(float x, float y);

    Object* getObject();
    void changePosition(float x, float y);
    b2Body* getBody();
    //    int idPosBonus;
    bool isUsed;
    
    bool hasToDisappear();

    void restartPlayer();
private:
    int id;
    float width;
    float height;

    Object *object;
    struct ObjectInit data;

    bool isEqual;
    bool hasDiedOrRevived;
    int dorsp;

    int timeToDisappear;
    std::chrono::time_point<std::chrono::system_clock> cronoStart;
    std::chrono::time_point<std::chrono::system_clock> cronoNow;

};

#endif	/* BONUS_H */

